local skel = fk.CreateSkill {
  name = "lb_zero__mengyao_hati",
}

Fk:loadTranslationTable {
  ["lb_zero__mengyao_hati"] = "哈提",
  [":lb_zero__mengyao_hati"] = "结束阶段，你可以视为使用一张无距离限制的【杀】，你因此造成伤害后摸一张牌。",

  ["#lb_zero__mengyao_hati"] = "哈提：你可以视为使用一张无距离限制的【杀】，你因此造成伤害后摸一张牌",

  ["$lb_zero__mengyao_hati1"] = "",
  ["$lb_zero__mengyao_hati2"] = "",
}


skel:addEffect(fk.EventPhaseStart, {
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.phase == Player.Finish 
  end,
  on_cost = function (self, event, target, player, data)
    local use = player.room:askToUseVirtualCard(player, {
      name = "slash",
      skill_name = skel.name,
      skip = true,
      prompt = "#lb_zero__mengyao_hati",
      extra_data = { bypass_distances = true }
    })
    if use then
      event:setCostData(self, {use = use})
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local use = event:getCostData(self).use
    use.extra_data = use.extra_data or {}
    use.extra_data.lb_zero__mengyao_hati = player
    player.room:useCard(use)
  end,
})

skel:addEffect(fk.Damage, {
  is_delay_effect = true,
  can_trigger = function (self, event, target, player, data)
    local parent = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard, true) --父事件
    return parent and target == player and player:hasSkill(skel.name) and data.card == parent.data.card
    and parent.data.extra_data and parent.data.extra_data.lb_zero__mengyao_hati == player
  end,
  on_use = function (self, event, target, player, data)
    player:drawCards(1, skel.name)
  end,
})

return skel
